package com.itheima.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

@Component
public class LoginNumberListener implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
        WebListener.Number++;
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        WebListener.Number--;
    }
}
